import {getFocusList, getTodayRecommend} from "@/api/adv";

const state = {
	focusList:[],
	// 今日推荐数据
	recommendList:[]
};
const mutations = {
	UP_FOCUSLIST(state,payload){
		state.focusList = payload;
	},
	UP_RECOMMEND_LIST(state,payload){
		state.recommendList = payload;
	}
};
const actions = {
	// 获取轮播图信息
	async getFocusListAsync({commit}){
		const res = await getFocusList();
		commit("UP_FOCUSLIST",res.focusList);
	},
	// 获取今日推荐
	async getTodayRecommendAsync({commit}){
		const res = await getTodayRecommend();
		commit("UP_RECOMMEND_LIST",res.recommendList);
		
	}
}
export default {
	namespaced:true,
	state,
	mutations,
	actions
}